#pragma once

#include "IRenderObject.h"

class CDXUTTextHelper;
struct ID3D10Effect;
struct ID3D10Buffer;
struct ID3D10InputLayout;


namespace e3d 
{
	class EnvironmentMap : public IRenderObject
	{
	public:
		const D3DXVECTOR3& position() const { return m_position; };
		const D3DXVECTOR3& rotation() const { return m_rotation; };
		const D3DXVECTOR3&  size()  const { return m_size; };
		unsigned int LOD() const { return 0; };
		unsigned int resolution() const { return 1; };

		void position( const D3DXVECTOR3& newPos ) { m_position = newPos; };
		void rotation( const D3DXVECTOR3& newRot ) { m_rotation = newRot; };
		void size( const D3DXVECTOR3& newSize ) { m_size = newSize; };

		e3d::BoundingBox boundingBox() const{ return e3d::BoundingBox(); };
		void renderBoundingBox( bool isEnabled ){ /*not implemented*/ UNREFERENCED_PARAMETER(isEnabled); };

		bool active() const { return m_isActive; };
		void active( bool status ){ m_isActive = status; };
		bool isCastingShadows(){ return false; };

		void render( ID3D10EffectTechnique* tech, const D3DXVECTOR3* camPos );

		EnvironmentMap(	ID3D10Device* device, ID3D10Effect* effect );
		~EnvironmentMap();

	private:
		D3DXVECTOR3 m_position;
		D3DXVECTOR3 m_rotation;
		D3DXVECTOR3 m_size;

		bool m_isActive;

		ID3D10Effect* m_effect;
		ID3D10Device* m_device;

		// D3D10 buffers and layout structures
		ID3D10Buffer* m_ndcBuffer;
		ID3D10InputLayout* m_ndcLayout;
		ID3D10ShaderResourceView* m_pCubeMapRV;
		ID3D10EffectShaderResourceVariable* m_pCubeMapVariable;
	};


}
